import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: () => import('@/views/login.vue') },
  { path: '/register', component: () => import('@/views/register.vue') },
  { path: '/shoucang', component: () => import('@/views/user/shoucang.vue') },
  { path: '/dianzan', component: () => import('@/views/user/dianzan.vue') },
  { path: '/wenzhang', component: () => import('@/views/user/wenzhang.vue') },
  { path: '/userinfo', component: () => import('@/views/user/userinfo.vue') },
  { path: '/detail/:id', component: () => import('@/views/detail.vue') },
  {
    path: '/fenleilist',
    component: () => import('@/views/fenleiliebiao/fenleilist.vue')
  },
  {
    path: '/',
    component: () => import('@/views/home.vue'),
    redirect: '/shouye',
    children: [
      { path: '/shouye', component: () => import('@/views/layout/shouye.vue') },
      { path: '/fenlei', component: () => import('@/views/layout/fenlei.vue') },
      { path: '/fabu', component: () => import('@/views/layout/fabu.vue') },
      { path: '/user', component: () => import('@/views/layout/user.vue') }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
